package client_gui;

import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;


/**
 * Klasa upravlja dogadjajima prozora client aplikacije.
 * 
 * @author UrosKrkic & Radivoje Popovic
 */
public class ClientWindowHandler extends WindowAdapter {

	/**
	 * Prozor client aplikacije.
	 */
	private ClientWindow owner;
	
	
	/**
	 * Konstruktor.
	 * @param owner - prozor aplikacije cijim se dogadjajima rukuje
	 * @author UrosKrkic & Radivoje Popovic
	 */
	public ClientWindowHandler(ClientWindow owner) {
		this.owner = owner;
	}
	
	
	@Override
	public void windowClosing(WindowEvent e) {
/*		
		if (owner.getActionManager().getLogoutAction().isEnabled() == true) {
			JButton logoutButton = new JButton(owner.getActionManager().getLogoutAction());
			logoutButton.doClick();			
		}
		else {
			owner.getApplicaton().stopClientServer();
			owner.getApplicaton().writeInputParameters();
			RLM_Parameters.storeParameters();
			ClientApplication.multicastReceived = false;
		}

		owner.dispose();
		System.exit(0);
*/		
		owner.setVisible(false);
	}
	
	
}
